<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="listenAttr2.js"></script>
</head>


<body>
	input:
	<input type="text" id="input1" value="?">
	<div>监听对象属性值的变化， console 实时输出监听信息...</div>
	<script type="text/javascript">
		defineProperty_demo(-1);
		var obj = {
			aa : 99999,
			name : 'wei',
			addr : {
				home : "shangHai"
			}
		};
		console.log(obj);
		if ("".length == 0) {
			js9.listenObj(obj, []);
		} else {
			js9.listenObj_asAttr(obj);//未生效
		}
		var times = 0;
		if ("".length == 0) {
			const ret1 = setInterval(function() {//赋值和显示都被拦截了
				++times;
				obj.aa += 3;
				obj.addr.home += times;
				document.getElementById("input1").value = "obj.aa=" + obj.aa;
			}, 3000);
		}
	</script>
</body>

</html>